﻿<%@ WebHandler Language="C#" Class="init" %>

using System;
using System.Web;
using System.Web.Configuration;   
using Newtonsoft.Json;
public class init : IHttpHandler {
        public static string APPID =WebConfigurationManager.AppSettings["APPID"];
        public static string APPSECRET =WebConfigurationManager.AppSettings["APPSECRET"];
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "application/json";


        //string query = HttpContext.Current.Request.Params["type"];
        //if (string.IsNullOrEmpty(query))
        //{
        //    HttpContext.Current.Response.Write("parameter error");
        //    return;
        //}

        var code = 1;
        var msg = "初始化数据";
        var time = DateTime.Now;



          
        String[] addons ={"alisms", "epay", "geetest", "kefu", "loginbg", "nkeditor", "shopro", "summernote", "wxo" };
                     String[] copyright ={ "欢乐小兵","Copyright 2021" };
            var info = new { name = "欢乐小兵", domain = "https://js.50cms.com", version = "", logo = "https://js.50cms.com/up/logo.gif",copyright };
        String[] payment ={ "wechat","wallet" };
        var share = new { goods_poster_bg = "https://js.50cms.com/up/bg2.png",
            groupon_poster_bg = "https://js.50cms.com/up/bg0.png",
            image = "https://js.50cms.com/up/ax.png",
            title = "邀请有礼",
            user_poster_bg = "https://js.50cms.com/up/bg.png" };

        var  wechat=new {appid=APPID, autologin=false};


        context.Response.Write(JsonConvert.SerializeObject(new { code,msg,time,data=new{addons,info,payment,share,wechat}}));
        HttpContext.Current.Response.End();
        //context.Response.Write("Hello World");


    }

public bool IsReusable {
    get {
        return false;
    }
}

}